DOCSP-46479: document Scout integration#3261
Conversation
norareidy
left a comment
There was a problem hiding this comment.
Nice work on this, I left some suggestions!
norareidy
left a comment
There was a problem hiding this comment.
LGTM with some small comments!
GromNaN
left a comment
There was a problem hiding this comment.
How about putting a note at the beginning to say that if the data is in MongoDB, it's possible to create a search index without using scout with a link to the search indexes.
Scout from MongoDB to MongoDB is only useful if you want to denormalize additional data (such as adding data from a relationship to the main document).
| - Provides an abstraction to create search indexes on documents in | ||
| MongoDB collections and external search engines. In MongoDB, this feature | ||
| allows you to create :atlas:`Atlas Search indexes | ||
| </atlas-search/manage-indexes/>`. |
There was a problem hiding this comment.
For this part I would not mention other search engines. It's more: create MongoDB Atlas Indexes from any model (SQL or MongoDB).
There was a problem hiding this comment.
I can update this list item; can you clarify how one would use Laravel MongoDB to work with SQL models? Is this possible, or is that a general statement about Laravel as a framework in general?
| .. note:: Deployment Compatibility | ||
|
|
||
| You can use Laravel Scout only when you connect to MongoDB Atlas | ||
| clusters. This feature is not available for self-managed or | ||
| serverless deployments. |
There was a problem hiding this comment.
Search indexes are available using atlas local, or the the mongodb/mongodb-atlas-local docker image (link). I use this docker image for testing.
There was a problem hiding this comment.
based on the language used on the website, Self-managed refers to Enterprise and Advanced and community edition MongoDB. So, I can adjust the first sentence to say deployments instead of clusters.
|
@GromNaN Qs:
|
GromNaN
left a comment
There was a problem hiding this comment.
Is the information about denormalizing the data helpful for users to know or is it in the technical weeds?
I'm not sure to understand your question. There is the method toSearchableArray to customize the documents that are sent to the search engine, that can be documented. And the part about retreiving ids from the search engine, then querying the database with this ids in good to know to understand the performance implications and the benefit of using atlas search directly on mongodb models.
Should the forthcoming tutorial (the TODO in this PR) that shows users how to use Scout to import into Meilisearch be centered in this page instead of the MongoDB to MongoDB examples?
I'm not certain we need to document indexation from MongoDB to an other search engine. That's already documented on the Laravel website: https://laravel.com/docs/11.x/scout
It "justs works" with MongoDB models.
| indexes, see the :ref:`laravel-as-index` section of the Atlas | ||
| Search guide. | ||
|
|
||
| - Allows you to automatically replicate data from MongoDB into a |
There was a problem hiding this comment.
It seems to me that “allows” is a word to be avoided (exept when talking about permissions, security). It's better to use "enable", for example.
GromNaN
left a comment
There was a problem hiding this comment.
LGTM. This is a good piece of docs.
https://jira.mongodb.org/browse/DOCSP-46479
Document the Scout integration.
STAGING
Checklist